<?PHP
  class MenuCreatorPage extends Editor{
    function __construct($page){
      $this->page = $page;
    }
  
    public function display(){
      $template = new Template();
      $template->load("menu_new");
      $template->show_if("NOTSUCCEEDED",isset($_POST['name']) == false);
      if($_GET['blank'] == true){
        $template->assign_var("URL",Settings::getInstance()->get("host")."admin/newmenu.html?blank=true");
      }
      else{
        $template->assign_var("URL",Settings::getInstance()->get("host")."admin/newmenu.html");
      }
      if(isset($_POST['name'])){
        $template->show_if("SUCCEEDED");
        $id = Menu::create($_POST['name'],$_SESSION['dir']);
        if(!$id){
          $template->load("message");
          $template->assign_var("MESSAGE",$language->getString("MENU_NOT_CREATED"));
        }
      }
      $template->output();
    }
    function getHeader(){
    }
    
    public function getEditableCode(){
      return "<input name=\"save\" type=\"submit\" value=\"&Auml;ndern\" onclick=\"form.action='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."' ; target='_self' ; return true\" />";
    }
    
    public function save($newPage,$oldPage){
    }    
  }
?>